package file;

import java.io.File;
import java.net.MalformedURLException;
import java.util.Calendar;
import java.util.GregorianCalendar;

public class FileMain {
	
	public static void main(String[] args) throws MalformedURLException {
		
		File file = new File("C:\\java-master2");
		
		if (file.exists()) {
			// 파일 작업
		}
		
		System.out.println("isFile(): " + file.isFile());
		System.out.println("isDirectory(): " + file.isDirectory());
		System.out.println("isHidden(): " + file.isHidden());
		System.out.println("lastModified(): " + file.lastModified());
		System.out.println("canRead(): " + file.canRead());
		System.out.println("canWrite(): " + file.canWrite());
		System.out.println("getPath(): " + file.getPath());
		System.out.println("getAbsolutePath(): " + file.getAbsolutePath());
		System.out.println("toURL(): " + file.toURL());
		System.out.println("exists(): " + file.exists());
		System.out.println("length(): " + file.length());
		
		Calendar c = new GregorianCalendar();
		c.set(Calendar.YEAR, 1970);
		c.set(Calendar.MONTH, 0);
		c.set(Calendar.DAY_OF_MONTH, 1);
		c.set(Calendar.HOUR_OF_DAY, 9);
		c.set(Calendar.MINUTE, 0);
		c.set(Calendar.SECOND, 0);
		c.set(Calendar.MILLISECOND, 0);
		
		System.out.println(c.getTimeInMillis());
	}
	
}
